home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Languguage OS 2
/
Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO
/
a_utils
/
perl
/
prlbkxmp.lha
/
ch6
/
retab
< prev
next >
Wrap
Text File
|
1991-01-08
|
260b
|
14 lines
#!/usr/bin/perl
# Usage: retab [-<tabwidth>] [files]
$sw = 4;
$sw = $1, shift if $ARGV[0] =~ /^-(\d+)/;
while (<>) {
s#^(\t+)#' ' x (length($1) * 8)#e;
s#^( *)#' ' x (length($1) * $sw / 8)#e;
s#^(( {8})*)#"\t" x (length($1) / 8)#e;
print;
}